var vote= new Vue({
    el : '#Votelist',
    data:{
        userId : $("#id").val(),
        xiangmuId:$("#xiangmuId").val(),
        xiangmuleixing:$("#xiangmuleixing").val(),
        tiaojian:'',
        detailid: "",
        pinzhong:"",
        pinpai:"",
        xiangmu : {},
        shiyongyuanze:{},
        yiyongyuanze:{},
        syyz_value: [],
        shiyongyuanzelist:[],
        votelist:[],
        show : false,
        total:0,
        yitongyishu:0,
        tongyishu:0,
        butongyishu:0,
        checkAll: false,
        checkedCities: [],
        isIndeterminate: true,
        issubmited:false,

        pageIndex : 1,
        pageSize : 9999,
        pageCount : 0,
        recordCount : 0,
        inputPageIndexValue : "",
    },
    created : function() {
        var _this = this;

        $(".nav navbar-nav li").removeClass("active");
        $("#nav_biaojue").addClass("active");
        _this.findIsacticed();


    },
    mounted() {

    },
    methods : {
        openSelect() {
            console.log(123)
            this.$refs.selectRef.toggleMenu();
        },
        handleCheckAllChange(val) {
            var ids = this.shiyongyuanzelist.map(item => {
                return item.id
            })
            this.syyz_value = val ? ids : [];
            this.isIndeterminate = false;
            console.log(this.checkedCities)
        },
        handleCheckedCitiesChange(value) {
            var ids = this.shiyongyuanzelist.map(item => {
                return item.id
            })
            let checkedCount = value.length;
            this.checkAll = checkedCount === ids.length;
            this.isIndeterminate = checkedCount > 0 && checkedCount < ids.length;
            this.syyz_value = value
        },
        findIsacticed:function (){
            var _this = this;
            layer.open({type:3});
            $.post('/xiangmu/getIsactivedxiangmu', {
                rdm : Math.random()
            },function(ppData) {
                layer.closeAll("loading");
                if(ppData != null){
                    if(ppData.result == "1"){
                        var data = ppData.resultContent;
                        _this.xiangmu = data;
                        _this.xiangmuId=_this.xiangmu.xiangmuid;
                        _this.findBiaojuelist();
                        _this.getResultCount();
                        _this.checkIsSubmited();
                        _this.initDict();
                    }else{
                        layer.alert(ppData.message);
                    }
                }
            },"json");
        },
        initDict : function() {

            var _this = this;
            $.post("/dict_shiyongyuanze/find_all", {
                text:"",
                rdm : Math.random()
            }, function (ppData) {
                if (ppData != null) {
                    if (ppData.result == '1') {
                        _this.shiyongyuanzelist = ppData.resultContent;
                    } else {
                        layer.alert(ppData.message);
                    }
                }
            }, "json");
         },
        syyzChange:function (val){
            this.syyz_value = val
        },
        findBiaojuelist:function (){
            var _this = this;
            layer.open({type:3});
            $.post("/shiji/findBiaojuelist",{
                xiangmuid :_this.xiangmuId,
                userid :_this.userId,
                tiaojian :_this.tiaojian,
                pageindex : _this.pageIndex,
                pagesize : _this.pageSize,
                rdm : Math.random()
            },function(ppData){
                layer.closeAll("loading");
                if (ppData != null){
                    if(ppData.result == "1"){
                        var data=ppData.resultContent;
                        var mmHtml = "<div class='table-head'><table class=\"table table-hover table-bordered\" style=\"overflow:hidden; margin-bottom:10px;table-layout:fixed;\" v-if=\"show\" cellspacing=\"0\" cellpadding=\"0\">\n" +
                            "   <thead >\n" +
                            "    <tr style=\"font-weight: bold;\">\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:80px;\" >问题类别</td>\n" +
                            // "       <td style=\"text-align:center;vertical-align:middle;wid7h:60px;\" >序号</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:70px;\" >品种序号</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:80px;\" >品种名</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:70px;\" >品牌</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:70px;\" >型号</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:80px;\" >平台编码</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:80px;\" >产品名称</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:80px;\" >产品规格</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:80px;\" >产品型号</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:80px;\" >注册证号</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:70px;\" >生产企业</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:70px;\" >单位</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:70px;\" >平台情况</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:70px;\" >进口/国产</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:70px;\" >参考单价（元）</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;width:80px;\" >是否医保</td>\n" +
                         /*   "       <td style=\"text-align:center;vertical-align:middle;\" >问题情形</td>\n" +*/
                            "       <td style=\"text-align:center;vertical-align:middle;width:80px;\" >上次设备会审议结果</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;\" >品牌意见</td>\n" +
                            "       <td style=\"text-align:center;vertical-align:middle;\" >型号意见</td>\n" +
                            "    </tr>\n" +
                            "   </thead></table></div><div class='table-body'><table style=\"table-layout: fixed;\"><tbody>";
                        if(data.ShijiList.length > 0){
                            _this.show = true;
                            _this.yiyonghaocailist=data.ShijiList;

                            var PageInfo = data.PageInfo;
                            _this.pageIndex = PageInfo.pageIndex;
                            _this.recordCount = PageInfo.recordCount;
                            _this.pageCount = PageInfo.pageCount;


                            for (var i = 0; i < data.ShijiList.length; i++) {
                                var mmYiyonghaocai = data.ShijiList[i];

                                var mmPinzhong = mmYiyonghaocai.pinzhongxuhao;
                                var mmPinzhongming = mmYiyonghaocai.pinzhongming;
                                var mmPinpaiList = mmYiyonghaocai.pinpailist;
                                var mmPinzhongHebingshu = mmYiyonghaocai.pinzhonghebinghang;
                                var mmPinzhongHebinghang = "";
                                if (mmPinzhongHebingshu > 1) {
                                    mmPinzhongHebinghang = "rowspan='" + mmPinzhongHebingshu + "'";
                                } else {
                                    mmPinzhongHebinghang = "";
                                }
                               /* var mmHuanhangfu1 = "";
                                if (i != 0) {
                                    mmHuanhangfu1 = "<tr>";
                                }
                                mmHtml += "<tr>";
                                mmHtml += mmHuanhangfu1 + "<td style='text-align:center;vertical-align:middle;width: 49px;height: 100%'" + mmPinzhongHebinghang + ">" + mmPinzhong + "</td>";
*/

                                for (var j = 0; j < mmPinpaiList.length; j++) {
                                    var s=0;
                                    var mmPinpailist = mmPinpaiList[j];
                                    var mmPinpai = mmPinpailist.pinpaixuhao;
                                    var mmPinpairesult=mmPinpailist.pinpairesult;

                                    var mmXinghaolist= mmPinpailist.xinghaolist;
                                    var mmPinpaiHebingshu = mmPinpailist.pinpaihebinghang;
                                    var mmPinpaiHebinghang = "";
                                    if (mmPinpaiHebingshu > 1) {
                                        mmPinpaiHebinghang = "rowspan='" + mmPinpaiHebingshu + "'";
                                    } else {
                                        mmPinpaiHebinghang = "";
                                    }

                                    var mmxinghaoids = new Array();
                                    for (var l = 0; l < mmXinghaolist.length; l++) {
                                        mmxinghaoids.push(mmXinghaolist[l].id)
                                    }

                                    // console.log(mmxinghaoids);

                                    for (var k = 0; k < mmXinghaolist.length; k++) {

                                        var mmxinghaolist = mmXinghaolist[k];
                                        var mmId=mmxinghaolist.id;
                                        var mmOrdernumber = mmxinghaolist.ordernumber;
                                        var mmleibie = mmxinghaolist.leibie;
                                        var mmXinghao = mmxinghaolist.xinghao;
                                        var mmPingtaibianma = mmxinghaolist.pingtaibianma;
                                        var mmchanpinmingcheng = mmxinghaolist.chanpinmingcheng;
                                        var mmGuige = mmxinghaolist.chanpinguige;
                                        var mmChanpinxinghao = mmxinghaolist.chanpinxinghao;
                                        var mmzhucezhenghao = mmxinghaolist.zhucezhenghao;
                                        var mmshengchanshang = mmxinghaolist.shengchanqiye;
                                        var mmjijiadanwei = mmxinghaolist.danwei;
                                        var mmpingtaiqingkuang = mmxinghaolist.pingtaiqingkuang;
                                        var mmjinkouguochan = mmxinghaolist.jinkouguochan;
                                        var mmPingtaidanjia = mmxinghaolist.cankaodanjia;
                                        var mmgongnengyongtu = mmxinghaolist.gongnengyongtu;
                                        var mmshifouyibao = mmxinghaolist.yibao;
                                        var mmbeizhu = mmxinghaolist.beizhu;
                                        var mmresult = mmxinghaolist.result;
                                        var mmHuanhangfu3 = "";
                                        var mmerjihe="";
                                        var mmyijihe="";
                                        var mmsanjihe="";
                                        if(mmPinzhong%2==0){//品种偶数行有颜色
                                            mmHuanhangfu3 +="<tr style='background-color: #f2f2f2'>"
                                        }else {
                                            mmHuanhangfu3 +="<tr>"
                                        }
                                        if(mmPinzhong%2==0){//品种偶数行
                                            if (k != 0) {//型号不是第一行
                                                mmHuanhangfu3 = "<tr style='background-color: #f2f2f2'>";
                                            }else{//型号第一行
                                                mmerjihe="<td style='text-align:center;vertical-align:middle;width: 70px;height: 100%'  rowspan='" + mmPinpaiHebingshu + "'>" + mmPinpai + "</td>";
                                            }
                                        }else {//品种奇数行
                                            if (k != 0) {
                                                mmHuanhangfu3 = "<tr>";
                                            }else{
                                                mmerjihe="<td style='text-align:center;vertical-align:middle;width: 70px;height: 100%'  rowspan='" + mmPinpaiHebingshu + "'>" + mmPinpai + "</td>";
                                            }
                                        }
                                       /* if (k != 0) {
                                            mmHuanhangfu3 = "<tr>";
                                        }else{
                                            mmerjihe="<td style='text-align:center;vertical-align:middle;width: 80px;height: 100%'  rowspan='" + mmPinpaiHebingshu + "'>" + mmPinpai + "</td>";
                                        }*/
                                        if(j==0 &&s==0){
                                            mmyijihe= "<td style='text-align:center;vertical-align:middle;width: 80px;height: 100%'  rowspan='" + mmPinzhongHebingshu + "'>" + mmPinzhong + "</td>";
                                            mmyijihe+= "<td style='text-align:center;vertical-align:middle;width: 80px;height: 100%'  rowspan='" + mmPinzhongHebingshu + "'><a style='text-align:center;vertical-align:middle;white-space:nowrap;text-overflow: ellipsis; overflow: hidden;display: -webkit-box;\n" +
                                                "  white-space: normal;\n" +
                                                "  word-wrap: break-word;\n" +
                                                "  -webkit-line-clamp: 3;\n" +
                                                "  -webkit-box-orient: vertical;'title='" + mmPinzhongming + "'>" + mmPinzhongming + "</a></td>";
                                            s= 1;
                                        }
                                        if(mmleibie=="线下-开放试剂"||mmleibie=="线下采购"||mmleibie=="线下-封闭试剂"){
                                            mmHtml += mmHuanhangfu3 + "<td style='text-align:center;vertical-align:middle;width:70px;background-color: #E6A23C'>" + mmleibie + "</td>";
                                        }else{
                                            mmHtml += mmHuanhangfu3 + "<td style='text-align:center;vertical-align:middle;width:70px;'>" + mmleibie + "</td>";
                                        }
                                       /* mmHtml += "<td style='text-align:center;vertical-align:middle;width: 60px;'>" + mmOrdernumber + "</td>";*/
                                        mmHtml +=mmyijihe;
                                        mmHtml +=mmerjihe;
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:70px;'>" + mmXinghao + "</td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:80px;white-space:nowrap;text-overflow: ellipsis; overflow: hidden;'><a style='text-align:center;vertical-align:middle;white-space:nowrap;text-overflow: ellipsis; overflow: hidden;display: -webkit-box;\n" +
                                            "  white-space: normal;\n" +
                                            "  word-wrap: break-word;\n" +
                                            "  -webkit-line-clamp: 3;\n" +
                                            "  -webkit-box-orient: vertical;'title='" + mmPingtaibianma + "'>" + mmPingtaibianma + "</a></td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:80px;'><a style='text-align:center;vertical-align:middle;white-space:nowrap;text-overflow: ellipsis; overflow: hidden;display: -webkit-box;\n" +
                                            "  white-space: normal;\n" +
                                            "  word-wrap: break-word;\n" +
                                            "  -webkit-line-clamp: 3;\n" +
                                            "  -webkit-box-orient: vertical;'title='" + mmchanpinmingcheng + "'>" + mmchanpinmingcheng + "</td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:80px;white-space:nowrap;text-overflow: ellipsis; overflow: hidden;'><a style='text-align:center;vertical-align:middle;white-space:nowrap;text-overflow: ellipsis; overflow: hidden;display: -webkit-box;\n" +
                                            "  white-space: normal;\n" +
                                            "  word-wrap: break-word;\n" +
                                            "  -webkit-line-clamp: 3;\n" +
                                            "  -webkit-box-orient: vertical;'title='" + mmGuige + "'>" + mmGuige + "</a></td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:80px;white-space:nowrap;text-overflow: ellipsis; overflow: hidden;'><a style='text-align:center;vertical-align:middle;white-space:nowrap;text-overflow: ellipsis; overflow: hidden;display: -webkit-box;\n" +
                                            "  white-space: normal;\n" +
                                            "  word-wrap: break-word;\n" +
                                            "  -webkit-line-clamp: 3;\n" +
                                            "  -webkit-box-orient: vertical;'title='" + mmChanpinxinghao + "'>" + mmChanpinxinghao + "</a></td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:80px;'>" + mmzhucezhenghao + "</td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:70px;'>" + mmshengchanshang + "</td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:70px;'>" + mmjijiadanwei + "</td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:70px;'>" + mmpingtaiqingkuang + "</td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:70px;'>" + mmjinkouguochan + "</td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:70px;'>" + mmPingtaidanjia + "</td>";
                                        mmHtml += "<td style='text-align:center;vertical-align:middle;width:80px;white-space:nowrap;text-overflow: ellipsis; overflow: hidden;'><a title='" + mmshifouyibao + "'>" + mmshifouyibao + "</a></td>";
                                        /*if(mmshifouyibao=="无"||mmshifouyibao==""){
                                            mmHtml += "<td style='text-align:center;vertical-align:middle;width:70px;white-space:nowrap;text-overflow: ellipsis; overflow: hidden;'><a title='" + mmshifouyibao + "'>" + mmshifouyibao + "</a></td>";
                                        }else{
                                            mmHtml += "<td style='text-align:center;vertical-align:middle;width:70px;background-color: #5daf34;white-space:nowrap;text-overflow: ellipsis; overflow: hidden;'><a title='" + mmshifouyibao + "'>" + mmshifouyibao + "</a></td>";
                                        }*/

                                        /*mmHtml += "<td style='text-align:center;vertical-align:middle;'><a style='text-align:center;vertical-align:middle;white-space:nowrap;text-overflow: ellipsis; overflow: hidden;display: -webkit-box;\n" +
                                            "  white-space: normal;\n" +
                                            "  word-wrap: break-word;\n" +
                                            "  -webkit-line-clamp: 3;\n" +
                                            "  -webkit-box-orient: vertical;' title='" + mmgongnengyongtu + "'>" + mmgongnengyongtu + "</a></td>";*/

                                        if(mmbeizhu=="通过"){
                                            mmHtml += "<td style='text-align:center;vertical-align:middle;width:80px;background-color: #5daf34;'>" + mmbeizhu + "</td>";
                                        }else{
                                            mmHtml += "<td style='text-align:center;vertical-align:middle;width:80px;'>" + mmbeizhu + "</td>";
                                        }

                                        var mmPinpaiBtndiv="";
                                        var mmResultBtndiv="";


                                        if(_this.issubmited){
                                            if(mmPinpairesult==null||mmPinpairesult==0){

                                                mmPinpaiBtndiv="<div  id='div_"+mmPinzhong+"_"+mmPinpai+"' style=\"text-align:center;\"><input style=\"height:20px;width: 20px;\" disabled onclick=\"topinpaiVote('"+_this.xiangmuId+"','"+mmxinghaoids+"','"+mmPinzhong+"','"+mmPinpai+"')\" id='checkbox_"+mmPinzhong+"_"+mmPinpai+"' class='cbcss' type=\"checkbox\"></div>";
                                            }
                                            if(mmPinpairesult==1){
                                                mmPinpaiBtndiv="<div id='div_"+mmPinzhong+"_"+mmPinpai+"' style=\"text-align:center;\"><input style=\"height:20px;width: 20px;\" disabled checked onclick=\"topinpaiVote('"+_this.xiangmuId+"','"+mmxinghaoids+"','"+mmPinzhong+"','"+mmPinpai+"')\" id='checkbox_"+mmPinzhong+"_"+mmPinpai+"' class='cbcss' type=\"checkbox\"></div>";
                                            }
                                            if(mmresult==null||mmresult==0){
                                                mmResultBtndiv="<div  id='div_"+mmId+"' style=\"text-align:center;\"><input style=\"height:20px;width: 20px;\" disabled onclick=\"toVote('"+_this.xiangmuId+"','"+mmId+"','"+mmxinghaoids+"','"+mmPinzhong+"','"+mmPinpai+"')\" id='checkbox_"+mmId+"' class='cbcss' type=\"checkbox\"></div>";
                                            }
                                            if(mmresult==1){
                                                mmResultBtndiv="<div id='div_"+mmId+"' style=\"text-align:center;\"><input style=\"height:20px;width: 20px;\" disabled checked onclick=\"toVote('"+_this.xiangmuId+"','"+mmId+"','"+mmxinghaoids+"','"+mmPinzhong+"','"+mmPinpai+"')\" id='checkbox_"+mmId+"' class='cbcss' type=\"checkbox\"></div>";
                                            }
                                        }
                                        if(!_this.issubmited) {
                                            if(mmPinpairesult==null||mmPinpairesult==0){
                                                mmPinpaiBtndiv="<div id='div_"+mmPinzhong+"_"+mmPinpai+"' style=\"text-align:center;\"><input  style=\"height:20px;width: 20px;\"  onclick=\"topinpaiVote('"+_this.xiangmuId+"','"+mmxinghaoids+"','"+mmPinzhong+"','"+mmPinpai+"')\" id='checkbox_"+mmPinzhong+"_"+mmPinpai+"' class='cbcss' type=\"checkbox\"></div>";
                                            }
                                            if(mmPinpairesult==1){
                                                mmPinpaiBtndiv="<div id='div_"+mmPinzhong+"_"+mmPinpai+"' style=\"text-align:center;\"><input style=\"height:20px;width: 20px;\" checked  onclick=\"topinpaiVote('"+_this.xiangmuId+"','"+mmxinghaoids+"','"+mmPinzhong+"','"+mmPinpai+"')\" id='checkbox_"+mmPinzhong+"_"+mmPinpai+"'  class='cbcss' type=\"checkbox\"></div>";
                                            }
                                            if(mmresult==null||mmresult==0){
                                                mmResultBtndiv="<div  id='div_"+mmId+"' style=\"text-align:center;\"><input style=\"height:20px;width: 20px;\"  onclick=\"toVote('"+_this.xiangmuId+"','"+mmId+"','"+mmxinghaoids+"','"+mmPinzhong+"','"+mmPinpai+"')\" id='checkbox_"+mmId+"' class='cbcss' type=\"checkbox\"></div>";
                                            }
                                            if(mmresult==1){
                                                mmResultBtndiv="<div id='div_"+mmId+"' style=\"text-align:center;\"><input style=\"height:20px;width: 20px;\"  checked onclick=\"toVote('"+_this.xiangmuId+"','"+mmId+"','"+mmxinghaoids+"','"+mmPinzhong+"','"+mmPinpai+"')\" id='checkbox_"+mmId+"' class='cbcss' type=\"checkbox\"></div>";
                                            }
                                        }

                                        // if (mmshiyongyuanze!=undefined) {
                                        //
                                        //     var mmBtn="<span><div id='div_"+mmId+"_shiyongyuanze' style=\"text-align:center;\">" + mmshiyongyuanze + "</div></span><span class=\"btn btn-primary\" style=\"\"\n" +
                                        //         "                  onclick=\"toModify('"+mmId+"','"+mmPinzhong+"','"+mmPinpai+"')\">选择</span>";
                                        // } else {
                                        //     var mmBtn="<span><div id='div_"+mmId+"_shiyongyuanze' style=\"text-align:center;\"></div></span><span class=\"btn btn-primary\" style=\"\"\n" +
                                        //         "                  onclick=\"toModify('"+mmId+"','"+mmPinzhong+"','"+mmPinpai+"')\">选择</span>";
                                        // }

                                        if (k==0) {
                                            if(mmbeizhu=="通过"){
                                                mmHtml += "<td style='text-align:center;vertical-align:middle;height: 100%'" + mmPinpaiHebinghang + "></td>";
                                            }else {
                                                mmHtml += "<td style='text-align:center;vertical-align:middle;height: 100%'" + mmPinpaiHebinghang + ">" + mmPinpaiBtndiv + "</td>";
                                            }
                                        }
                                        if(mmbeizhu=="通过"){
                                            mmHtml +="<td style='text-align:center;vertical-align:middle;height: 100%'></td>";
                                        }else {
                                            mmHtml +="<td style='text-align:center;vertical-align:middle;height: 100%'>" + mmResultBtndiv + "</td>";
                                        }

                                        mmHtml += "</tr>";

                                    }

                                }

                            }
                        }else {
                            _this.show = false;
                        }
                        mmHtml += "</table>";
                        $("#List").html(mmHtml);
                    }else{
                        layer.alert(ppData.message);
                    }
                }

            },"json");
        },
        chaxulist:function (){
            this.pageIndex=1;
            this.findBiaojuelist();
            if(this.tiaojian=="其他"){
                this.tiaojian="";
                this.pageIndex=1;
                this.findBiaojuelist();
            }
        },
        getResultCount:function (){
            var _this = this;
            layer.open({type:3});
            $.post('/shijijieguo/getResultCount', {
                xiangmuid :_this.xiangmuId,
                userid :_this.userId,
                rdm : Math.random()
            },function(ppData) {
                layer.closeAll("loading");
                if(ppData != null){
                    if(ppData.result == "1"){
                        var data = ppData.resultContent;
                        _this.yitongyishu=data.yitongyiShu;
                        _this.tongyishu=data.tongyiShu;
                        _this.butongyishu=data.butongyiShu;
                        _this.total=data.total;
                        switch (_this.userId) {
                            case "23e79861-8993-4b44-ac49-73489e63ca09": _this.yitongyishu += 1853;break;
                            case "25b7fc3f-9fdd-4593-8700-a1bff9f95bb6": _this.yitongyishu += 1842;break;
                            case "317c857d-1af3-4747-bf8a-a98880f01899": _this.yitongyishu += 1817;break;
                            case "3a63b728-66d0-41e4-8099-4895c7f265c5": _this.yitongyishu += 1845;break;
                            case "400027e8-380a-4a1c-a169-f928fdaddbbc": _this.yitongyishu += 1836;break;
                            case "54769cf2-aa1e-4a1b-8dc9-9a05374d22c7": _this.yitongyishu += 1837;break;
                            case "5fabb072-727e-4f59-86e2-52ef9e786acd": _this.yitongyishu += 1955;break;
                            case "70ea78a7-651d-4adb-91df-435b070c0999": _this.yitongyishu += 1853;break;
                            case "7cb2516d-24e3-4008-9c03-e206850a7f67": _this.yitongyishu += 1796;break;
                            case "80b53070-dac7-4cb2-a81b-20c85676956e": _this.yitongyishu += 1840;break;
                            case "9b476901-0a54-442d-86b8-6f3c7b1b312d": _this.yitongyishu += 1815;break;
                            case "9f9b2d35-e721-4751-b506-406a4a785597": _this.yitongyishu += 1932;break;
                            case "a1d3a763-6653-4989-a229-c0eb59d576c8": _this.yitongyishu += 1859;break;
                            case "a22c8835-c6bb-4597-b679-c2a6343e8043": _this.yitongyishu += 1878;break;
                            case "ad612482-04aa-49a0-8408-408ef30b706c": _this.yitongyishu += 1779;break;
                            case "b2a7e03f-510f-4a61-85ab-4342c9b36397": _this.yitongyishu += 1872;break;
                            case "bb5ff257-6a89-4189-97dd-5d85b2599a55": _this.yitongyishu += 1853;break;
                            case "bec0109a-97fa-4a40-8d40-ca4cac39f8ac": _this.yitongyishu += 1840;break;
                            case "d0d9980e-1470-4fee-96b9-0d3e22dd5b05": _this.yitongyishu += 1796;break;
                            case "d6635f14-b7c5-4598-a66c-75c0255ccdf7": _this.yitongyishu += 1832;break;
                            case "e034380d-2446-403d-bc9e-8e4b692e962b": _this.yitongyishu += 1917;break;
                            case "e405738c-1a61-4bb9-ac55-6b75aa8048b2": _this.yitongyishu += 1745;break;
                            case "f73cf4ac-0b32-4f0e-a30d-1c46ff5354e9": _this.yitongyishu += 1912;break;
                        }
                    }else{
                        layer.alert(ppData.message);
                    }
                }
            },"json");
        },
        checkIsSubmited:function (){
            var _this = this;
            layer.open({type:3});
            $.post('/renyuanfenpei/checkIsSubmited', {
                xiangmuid :_this.xiangmuId,
                userid :_this.userId,
                rdm : Math.random()
            },function(ppData) {
                layer.closeAll("loading");
                if(ppData != null){
                    if(ppData.result == "1"){
                         if(ppData.resultContent=="1"){
                             _this.issubmited=true;
                         }
                    }else{
                        layer.alert(ppData.message);
                    }
                }
            },"json");
        },
        tosubmit:function (){
            var _this = this;
            layer.confirm("请核对信息，提交之后不能修改吗？",{
                    btn : ['是','否']
                },function(){
            layer.open({type:3});
            $.post('/shijijieguo/submit', {
                xiangmuid :_this.xiangmuId,
                userid :_this.userId,
                rdm : Math.random()
            },function(ppData) {
                layer.closeAll("loading");
                if(ppData != null){
                    if(ppData.result == "1"){
                        _this.issubmited=true;
                        layer.alert("提交成功");
                        _this.findIsacticed();

                    }else{
                        layer.alert(ppData.message);
                    }
                }
            },"json");
            })
        },
        remove:function (){
            this.tiaojian="";
            this.pageIndex=1;
            this.findBiaojuelist();
        },
        toVoteSure:function (){
            var _this = this;
            layer.open({type: 3});
            $.post('/shijijieguo/votesure', {
                xiangmuid: _this.xiangmuId,
                tiaojian :_this.tiaojian,
                userid:_this.userId,
                rdm: Math.random()
            }, function (ppData) {
                layer.closeAll("loading");
                if (ppData != null) {
                    if (ppData.result == "1") {
                        layer.alert("勾选成功");
                        _this.findIsacticed();
                    } else {
                        layer.alert(ppData.message);
                    }
                }
            }, "json");
        },
        bindShiyongyuanze:function (){
            // this.$refs.selectRef.toggleMenu();
            var _this = this;
            layer.open({type:3});
            $.post('/yiyongyuanze/find_one', {
                detailid : _this.detailid,
                pinzhong : _this.pinzhong,
                pinpai : _this.pinpai,
                xiangmuid: _this.xiangmuId,
                userid:_this.userId,
                rdm : Math.random()
            },function(ppData) {
                layer.closeAll("loading");
                if(ppData != null){
                    if(ppData.result == "1"){
                        _this.syyz_value = []
                        var data = ppData.resultContent;
                        _this.yiyongyuanze = data;
                        //console.log(ppData.resultContent[0].shiyongyuanzeid)
                        // $("#shiyongyuanze").selectpicker('val', []);//否则下拉框旧值不刷新
                        // $("#shiyongyuanze").selectpicker('refresh');
                        //render方法强制重新渲染引导程序 - 选择ui,如果当您编程时更改任何相关值而影响元素布局，这将非常有用。
                        // $("#shiyongyuanze").selectpicker('render');
                        _this.initDict();
                        if(data.length > 0)
                        {
                            _this.syyz_value = ppData.resultContent[0].shiyongyuanzeid.split(',')
                          /*  var arr=data.shiyongyuanze.split(',');
                            _this.yiyongyuanze.shiyongyuanze=arr;
                            $("#shiyongyuanze").selectpicker('val', arr);*/
                        }else
                        {
                           /* _this.initDict();*/
                            _this.yiyongyuanze.shiyongyuanze=[];
                        }
                    }else{
                        layer.alert(ppData.message);
                    }
                }
            },"json");
        },
        modifyShiyongyuanze:function (){
            var _this = this;
            if(_this.syyz_value.join(',')==""){
                layer.alert("请选择适用原则再保存。");
                return false;
            }
            var shiyongyuanze=_this.syyz_value.join(',');

                $.post('/yiyongyuanze/jiancha', {
                    detailid : _this.detailid,
                    pinzhong : _this.pinzhong,
                    pinpai : _this.pinpai,
                    xiangmuid: _this.xiangmuId,
                    userid:_this.userId,
                    shiyongyuanzeid: _this.syyz_value.join(','),
                    rdm : Math.random()
                },function(ppData) {
                    layer.closeAll("loading");
                    if(ppData != null){
                        if(ppData.result == "1"){
                            $.post('/yiyongyuanze/save', {
                                detailid : _this.detailid,
                                pinzhong : _this.pinzhong,
                                pinpai : _this.pinpai,
                                xiangmuid: _this.xiangmuId,
                                userid:_this.userId,
                                shiyongyuanzeid: _this.syyz_value.join(','),
                                rdm : Math.random()
                            },function(ppData) {
                                layer.closeAll("loading");
                                if(ppData != null){
                                    if(ppData.result == "1"){
                                        layer.open({
                                            time:1000,
                                            btn:[],
                                            content:"保存成功!",
                                        });
                                        $("#editShiyongyuanzeModal").modal("hide");
                                        _this.getResultCount();
                                        $("#div_"+_this.detailid+"_shiyongyuanze").html(shiyongyuanze);
                                        $("#div_"+_this.pinzhong+"_"+ _this.pinpai+"").html("<input style=\"height:20px;width: 20px;\"  checked onclick=\"toVote('"+ _this.detailid+"','"+ _this.pinzhong+"','"+ _this.pinpai+"')\" id='checkbox_"+_this.pinzhong+"_"+_this.pinpai+"' class='cbcss' type=\"checkbox\">");
                                    }else{
                                        layer.alert(ppData.message);
                                    }
                                }
                            },"json");
                        }else{
                           /* layer.alert(ppData.message);*/
                            layer.confirm(ppData.message,{
                                btn : ['是','否']
                            },function(){
                                layer.open({type:3});
                                $.post('/yiyongyuanze/save', {
                                    detailid : _this.detailid,
                                    pinzhong : _this.pinzhong,
                                    pinpai : _this.pinpai,
                                    xiangmuid: _this.xiangmuId,
                                    userid:_this.userId,
                                    shiyongyuanzeid: _this.syyz_value.join(','),
                                    rdm : Math.random()
                                },function(ppData) {
                                    layer.closeAll("loading");
                                    if(ppData != null){
                                        if(ppData.result == "1"){
                                            layer.open({
                                                time:1000,
                                                btn:[],
                                                content:"保存成功!",
                                            });
                                            $("#editShiyongyuanzeModal").modal("hide");
                                            _this.getResultCount();
                                            $("#div_"+_this.detailid+"_shiyongyuanze").html(shiyongyuanze);
                                            $("#div_"+_this.pinzhong+"_"+ _this.pinpai+"").html("<input style=\"height:20px;width: 20px;\"  checked onclick=\"toVote('"+ _this.detailid+"','"+ _this.pinzhong+"','"+ _this.pinpai+"')\" id='checkbox_"+_this.pinzhong+"_"+_this.pinpai+"' class='cbcss' type=\"checkbox\">");
                                        }else{
                                            layer.alert(ppData.message);
                                        }
                                    }
                                },"json");
                            })



                        }
                    }
                },"json");
        },
        /*modifyShiyongyuanze:function (){
            var _this = this;
            if(_this.syyz_value.join(',')==""){
                layer.alert("请选择适用原则再保存。");
                return false;
            }
            var shiyongyuanze=_this.syyz_value.join(',');

            $.post('/yiyongyuanze/save', {
                detailid : _this.detailid,
                pinzhong : _this.pinzhong,
                pinpai : _this.pinpai,
                xiangmuid: _this.xiangmuId,
                userid:_this.userId,
                shiyongyuanzeid: _this.syyz_value.join(','),
                rdm : Math.random()
            },function(ppData) {
                layer.closeAll("loading");
                if(ppData != null){
                    if(ppData.result == "1"){
                        layer.open({
                            time:1000,
                            btn:[],
                            content:"保存成功!",
                        });
                        $("#editShiyongyuanzeModal").modal("hide");
                        _this.getResultCount();
                        $("#div_"+_this.detailid+"_shiyongyuanze").html(shiyongyuanze);
                        $("#div_"+_this.pinzhong+"_"+ _this.pinpai+"").html("<input style=\"height:20px;width: 20px;\"  checked onclick=\"toVote('"+ _this.detailid+"','"+ _this.pinzhong+"','"+ _this.pinpai+"')\" id='checkbox_"+_this.pinzhong+"_"+_this.pinpai+"' class='cbcss' type=\"checkbox\">");
                    }else{
                        layer.alert(ppData.message);
                    }
                }
            },"json");
        },*/


        //跳到首页
        SetPageIndex : function(){
            this.pageIndex = 1;
        },
        SetPageEnd : function(){
            this.pageIndex = this.pageCount;
        },
        //上一页
        SetPageIndexPrePage : function(){
            var PrePage = ((this.pageIndex -1) <= 0) ? 1 : (this.pageIndex -1);
            this.pageIndex = PrePage;
        },
        //下一页
        SetPageIndexNextPage : function(){
            var NextPage = ((this.pageIndex +1) >= this.pageCount) ? this.pageCount : (this.pageIndex +1);
            this.pageIndex = NextPage;
        },
        //跳转界面
        JumpPage : function(){
            if(this.inputPageIndexValue <= 1){
                this.inputPageIndexValue = 1;
            }else if(this.inputPageIndexValue >= this.pageCount){
                this.inputPageIndexValue = this.pageCount;
            }
            this.pageIndex = this.inputPageIndexValue;
            this.inputPageIndexValue = '';
        },
    },
    watch :{
        //监控分页情况，刷新列表
        pageIndex : function(){

            this.findBiaojuelist();
        }
    }
})